import request from '@/utils/request'


// 首页
export function crmCustomerIndex(data) {
  return request({
    url: 'customer/index',
    method: 'post',
    data: data
  })
}

// 未收费
export function crmCustomerNocharge(data) {
  return request({
    url: 'customer/nocharge',
    method: 'post',
    data: data
  })
}

// 收费
export function crmCustomerCharge(data) {
  return request({
    url: 'customer/charge',
    method: 'post',
    data: data
  })
}

// 公海池
export function crmCustomerPool(data) {
  return request({
    url: 'customer/pool',
    method: 'post',
    data: data
  })
}

// 没掉公海池
export function crmCustomerNopool(data) {
  return request({
    url: 'customer/nopool',
    method: 'post',
    data: data
  })
}


// 手机号码验重
export function checkPhone(data) {
  return request({
    url: 'customer/checkPhone',
    method: 'post',
    data: data
  })
}

// crm 新增客户
export function crmCustomerSave(data) {
  return request({
    url: 'customer/save',
    method: 'post',
    data: data
  })
}

// crm 修改客户
export function crmCustomerUpdate(data) {
  return request({
    url: 'customer/update',
    method: 'post',
    data: data
  })
}

// crm 关注/取消关注
export function crmCustomerFocus(data) {
  return request({
    url: 'customer/focus',
    method: 'post',
    data: data
  })
}

// crm 详情
export function crmCustomerRead(data) {
  return request({
    url: 'customer/read',
    method: 'post',
    data: data
  })
}

// crm 客户删除
export function crmCustomerDelete(data) {
  return request({
    url: 'customer/delete',
    method: 'post',
    data: data
  })
}

// crm 转移客户
export function crmCustomerTransfer(data) {
  return request({
    url: 'customer/transfer',
    method: 'post',
    data: data
  })
}

// crm 放入公海池
export function crmCustomerThrow(data) {
  return request({
    url: 'customer/throw',
    method: 'post',
    data: data
  })
}

// crm 分享客户
export function crmCustomerShare(data) {
  return request({
    url: 'customer/share',
    method: 'post',
    data: data
  })
}

// crm 分配客户
export function crmCustomerAlloc(data) {
  return request({
    url: 'customer/distribute',
    method: 'post',
    data: data
  })
}

// crm 领取客户
export function crmCustomerReceive(data) {
  return request({
    url: 'customer/receive',
    method: 'post',
    data: data
  })
}

/**
 * 客户导出
 * @param {*} data
 * customer_id 客户ID
 */
export function crmCustomerExcelExport(data) {
  return request({
    url: 'customer/excelExport',
    method: 'post',
    data: data,
    responseType: 'blob',
    timeout: 600000
  })
}



/**
 * 公海导出
 * @param {*} data
 */
export function crmCustomerPoolExcelExportAPI(data) {
  return request({
    url: 'customer/poolExcelExport',
    method: 'post',
    data: data,
    responseType: 'blob',
    timeout: 600000
  })
}

/**
 * 联系人
 * @param {*} data
 */
export function crmContactsIndex(data) {
  return request({
    url: 'customer/contacts',
    method: 'post',
    data: data
  })
}

/**
 * 新增联系人
 * @param {*} data
 */
export function crmContactsSave(data) {
  return request({
    url: 'customer/save_contacts',
    method: 'post',
    data: data
  })
}

/**
 * 修改联系人
 * @param {*} data
 */
export function crmContactsUpdate(data) {
  return request({
    url: 'customer/update_contacts',
    method: 'post',
    data: data
  })
}

/**
 * 删除联系人
 * @param {*} data
 */
export function crmContactsDel(data) {
  return request({
    url: 'customer/del_contacts',
    method: 'post',
    data: data
  })
}


/**
 * 团队成员
 * @param {*} data
 */
export function crmCustomerTeam(data) {
  return request({
    url: 'customer/team',
    method: 'post',
    data: data
  })
}

/**
 * 新增团队成员
 * @param {*} data
 */
export function crmCustomerTeamSave(data) {
  return request({
    url: 'customer/save_team',
    method: 'post',
    data: data
  })
}


/**
 * 移除团队成员
 * @param {*} data
 */
export function crmCustomerTeamDel(data) {
  return request({
    url: 'customer/del_team',
    method: 'post',
    data: data
  })
}

/**
 * 客户统计
 * @param {*} data
 */
export function crmCustomerStatistics(data) {
  return request({
    url: 'customer/statistics',
    method: 'post',
    data: data
  })
}


/**
 * 操作记录
 * @param {*} data
 */
export function crmActionRecord(data) {
  return request({
    url: 'customer/actionrecord',
    method: 'post',
    data: data
  })
}

/**
 * 关联案件
 * @param {*} data
 */
export function crmCustomerTolawcase(data) {
  return request({
    url: 'customer/tolawcase',
    method: 'post',
    data: data
  })
}

/**
 * 关联顾问
 * @param {*} data
 */
export function crmCustomerTocontract(data) {
  return request({
    url: 'customer/contract',
    method: 'post',
    data: data
  })
}

/**
 * 新增谈单信息
 * @param {*} data
 */
export function crmCustomerNochargeSave(data) {
  return request({
    url: 'customer/save_nocharge',
    method: 'post',
    data: data
  })
}

/**
 * 新增谈单信息
 * @param {*} data
 */
export function crmCustomerNochargeUpdate(data) {
  return request({
    url: 'customer/update_nocharge',
    method: 'post',
    data: data
  })
}

/**
 * 新增谈单信息
 * @param {*} data
 */
export function crmCustomerNochargeDel(data) {
  return request({
    url: 'customer/del_nocharge',
    method: 'post',
    data: data
  })
}

/**
 * 日志
 * @param {*} data
 */
export function crmlogsIndex(data) {
  return request({
    url: 'customer/logs',
    method: 'post',
    data: data
  })
}


/**
 * 修改日志
 * @param {*} data
 */
export function crmlogsUpdate(data) {
  return request({
    url: 'customer/updaterecord',
    method: 'post',
    data: data
  })
}